package com.yfp.operation.controller;

import com.yfp.common.core.web.controller.BaseController;
import com.yfp.common.core.web.page.TableDataInfo;
import com.yfp.operation.domain.dto.ClientHealthInfoDTO;
import com.yfp.operation.domain.dto.ClientHealthListDTO;
import com.yfp.operation.domain.vo.ClientHealthInfoVO;
import com.yfp.operation.domain.vo.ClientHealthListVO;
import com.yfp.operation.service.ClientHealthLogService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 
 * @version 1.0
 * @date 2025-02-11 15:41
 */
@RestController
@RequestMapping("/clientHealth")
@Tag(name = "用户热量档案")
public class ClientHealthController extends BaseController {


    @Resource
    private ClientHealthLogService clientHealthLogService;


    @GetMapping("/list")
    @Operation(summary = "档案列表")
    public TableDataInfo<ClientHealthListVO> clientHealthList(ClientHealthListDTO clientHealthListDTO) {
        startPage();
        List<ClientHealthListVO> list = clientHealthLogService.clientHealthList(clientHealthListDTO);
        TableDataInfo dataTable = getDataTable(list);
        list = clientHealthLogService.clientHealthListComplement(list);
        dataTable.setRows(list);
        return dataTable;
    }


    @GetMapping("/info")
    @Operation(summary = "每餐饮食详情")
    public TableDataInfo<ClientHealthInfoVO> clientHealthInfo(ClientHealthInfoDTO clientHealthInfoDTO){
        startPage();
        List<ClientHealthInfoVO> list = clientHealthLogService.clientHealthInfo(clientHealthInfoDTO);
        return getDataTable(list);
    }




}
